<?php

namespace Sharks\Core\Support\FrontEnd;

use Exception;

class CopyHandler {

    public static function handle($filePath, $destAssetDir, $destFile) {
        if (AssetHandler::compareTime($filePath, $destAssetDir . '/' . $destFile->filename . '.' . $destFile->extension)) {

            if (!is_dir($destAssetDir)) {
                mkdir($destAssetDir, 0700, true);
            }
            copy($filePath, $destAssetDir . '/' . $destFile->filename . '.' . $destFile->extension);
        }
    }
}